# 插入排序再练习
# 2022-5-16
# 逐个获取列表中的数据, 插入到之前已经比较好的数据合适位置
from utils.array_utils import *


def sort01(ll):
    for i in range(len(ll)):
        j = i - 1
        cur = ll[i]
        while j >= 0 and ll[j] > cur:
            ll[j + 1] = ll[j]
            j -= 1
        ll[j + 1] = cur


if __name__ == '__main__':
    l = [58, 29, 86, 69, 10]
    l = [87, -5, 91, 2, -51, 22, -18, -84, 49, 56]
    sort01(l)
    print(l)
    print(check_all(sort01, 1000))
